package blackjack;

import javax.swing.JOptionPane;

public class Status {
		
	//Constructor

	public Status(Hand dHand, Hand pHand, boolean dFlip){
	
		int dTotal;
		String dCards;
		if (dFlip) {dTotal = dHand.count();} else {dTotal = dHand.hiddenCount();}
		if (dFlip) {dCards = dHand.cardList();} else {dCards = dHand.hiddenCardList();}
		
				
		int pTotal = pHand.count();		
		String pCards = "Your " + pHand.cardList();

		String dTotalStr = "" + dTotal;
		String pTotalStr = "" + pTotal;
		
		int dTotal2 = dTotal + 10;
		int pTotal2 = pTotal + 10;
		
		if (dHand.hasAce()) {dTotalStr = dTotalStr + " or " + dTotal2;}; 
		if (pHand.hasAce()) {pTotalStr = pTotalStr + " or " + pTotal2;};
			
		
		
		JOptionPane.showMessageDialog(null, 
				"Dealer " + dCards + "\n\n"+
						pCards+
						"\n\nYour count is: " + pTotalStr +
						"\n\nDealer is showing: " + dTotalStr + "\n\n", "Status", JOptionPane.INFORMATION_MESSAGE);
	}
}